<!DOCTYPE html>
<html lang="en">
<head>
	<title>快速关单</title>
	<meta name="viewport" content="width=device-width, minimum-scale=1, initial-scale=1, maximum-scale=1, user-scalable=no" charset="UTF-8">
	<link rel="stylesheet" href="android_asset://css/style.css"/>
    <link rel="stylesheet" href="android_asset://css/font.css"/>
</head>
<body>
	<div id="close">
		<form class="form-horizontal" id="form" style="position: relative;" action="/tickets/{{ticketId}}/breakoff">
		<input type="hidden" name="action" value="breakoff"/>
		<input type="hidden" name="ticketid" value="{{ticketId}}"/>
		  <div class="form-group clearfix martop">
		  	<div class="content bortno">
			    <label  class="left control-label">关单原因</label>
			    <div class="right">
			     	<input type="text" required class="form-control"  placeholder="请选择" readonly="readonly" id="single_reason" onclick="breakoffreason(this,'#backreasonapp')"/>
			     	<span class="icon-rightarrow"></span>
			     	<input type="hidden" name="backreasonapp" id="backreasonapp"/>
			    </div>
			</div>
		  </div>
		  
		  <div class="form-group clearfix martop bortno">
		  	<div class="content">
			    <label class="left control-label">描述</label>
			    <div class="describe">
					<textarea cols="30" name="description" id="description" rows="5" style="width:100%"></textarea>
			    </div>
			</div>
		  </div>
		  <span　class="content_text" style="color:red; margin: 1.2em;font-size: 1.4em;">*快速关单无结费</span>
		</form>
		<div class="confirm">
			<button type="button" class=""><a href="javascript:void(0);">确认</a></button>
		</div>
	</div>
</body>
<script src="android_asset://jquery-1.11.0.min.js" type="text/javascript"></script>
<script src="android_asset://jquery-migrate-1.2.1.min.js" type="text/javascript"></script>
<script src="android_asset://bridge.js" type="text/javascript"></script>
<script src="android_asset://android.js" type="text/javascript"></script>
<script type="text/javascript">
	$(function(){
		//提交快速关单
		$('.confirm button').click(function(){
			if($("#backreasonapp").val()==''){
				msAndroid.toast("请选择关单原因");
				return;
			}
			//var formJson=msAndroid.changedTicketVO("#form");
			var formJson = {};
			formJson.ticketid = $("input[name='ticketid']").val();
			formJson.action = $("input[name='action']").val();
			formJson.fields = {};
			var backreasonapp = $("#backreasonapp").val();
			var description = $("#description").val();
			formJson.fields.backreasonapp = backreasonapp + description;
			var url=$("#form").attr("action");
			var attJson=msAndroid.attVO("#form");
			if(attJson.original!=null){
				msAndroid.post("/tickets/{{ticketId}}/attachments/info",attJson);
			}
			msAndroid.post(url,formJson,"put","active");
		});
	})
</script>
</html>